home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume16 / gnuplot2.02 / patch2 < prev    next >
Encoding:
Internet Message Format  |  1991-01-05  |  52.7 KB

  1. From: rjl@monu1.cc.monash.edu.au (Russell Lang)
  2. Newsgroups: comp.sources.misc
  3. Subject: v16i012:  Gnuplot 2.0 patch 2, 2 of 7
  4. Message-ID: <1991Jan5.035145.2351@sparky.IMD.Sterling.COM>
  5. Date: 5 Jan 91 03:51:45 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: b1409ea5 e2c7b52f aa3a1411 27a73e5e
  8.  
  9. Submitted-by: Russell Lang <rjl@monu1.cc.monash.edu.au>
  10. Posting-number: Volume 16, Issue 12
  11. Archive-name: gnuplot2.02/patch2
  12. Patch-To: gnuplot2.0: Volume 11, Issue 65-79
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of shell archive."
  21. # Contents:  patch2a
  22. # Wrapped by eln272v@monu1 on Wed Dec 19 11:57:18 1990
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f patch2a -a "${1}" != "-c" ; then 
  25.   echo shar: Will not over-write existing file \"patch2a\"
  26. else
  27. echo shar: Extracting \"patch2a\" \(50620 characters\)
  28. sed "s/^X//" >patch2a <<'END_OF_patch2a'
  29. Xdiff -cr ./README ../gnuplot2.02/README
  30. X*** ./README    Tue Sep 18 14:56:36 1990
  31. X--- ../gnuplot2.02/README    Tue Dec 11 16:40:48 1990
  32. X***************
  33. X*** 208,213
  34. X     AED         AED 512 and AED 767
  35. X     ATT6300     PC with AT&T 6300 graphics
  36. X     BITGRAPH    BBN BitGraph
  37. X     CORONA      PC with Corona graphics 325
  38. X     DXY800A     Roland DXY800A plotter
  39. X     EEPIC       EEPIC-extended LaTeX driver, for EEPIC users
  40. X
  41. X--- 208,214 -----
  42. X     AED         AED 512 and AED 767
  43. X     ATT6300     PC with AT&T 6300 graphics
  44. X     BITGRAPH    BBN BitGraph
  45. X+    CGI         SCO CGI
  46. X     CORONA      PC with Corona graphics 325
  47. X     DXY800A     Roland DXY800A plotter
  48. X     EEPIC       EEPIC-extended LaTeX driver, for EEPIC users
  49. X***************
  50. X*** 220,226
  51. X     HP26        HP2623A and maybe others
  52. X     HP75        HP7580, and probably other HPs
  53. X     HPGL        HP7475 and (hopefully) lots of others
  54. X!    HPLJET      HP Laserjet
  55. X     IMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  56. X     IRIS4D      IRIS4D series computer
  57. X     KERMIT      MS-Kermit Tektronix 4010 emulator
  58. X
  59. X--- 221,227 -----
  60. X     HP26        HP2623A and maybe others
  61. X     HP75        HP7580, and probably other HPs
  62. X     HPGL        HP7475 and (hopefully) lots of others
  63. X!    HPLJII      HP Laserjet II
  64. X     IMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  65. X     IRIS4D      IRIS4D series computer
  66. X     KERMIT      MS-Kermit Tektronix 4010 emulator
  67. X***************
  68. X*** 227,233
  69. X     LATEX       LATEX picture environment
  70. X     NEC         NEC CP6 pinwriter printer
  71. X     POSTSCRIPT  Postscript
  72. X!    PROPRINTER  IBM Proprinter
  73. X     QMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  74. X     REGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  75. X     SELANAR     Selanar
  76. X
  77. X--- 228,234 -----
  78. X     LATEX       LATEX picture environment
  79. X     NEC         NEC CP6 pinwriter printer
  80. X     POSTSCRIPT  Postscript
  81. X!    PRESCRIBE   Kyocera Laser printer
  82. X     QMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  83. X     REGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  84. X     SELANAR     Selanar
  85. X***************
  86. X*** 239,244
  87. X     UNIXPC      unixpc (ATT 3b1 or ATT 7300)
  88. X     UNIXPLOT    unixplot
  89. X     V384        Vectrix 384 and tandy color printer
  90. X     X11         X11R4 window system
  91. X  
  92. X  
  93. X
  94. X--- 240,246 -----
  95. X     UNIXPC      unixpc (ATT 3b1 or ATT 7300)
  96. X     UNIXPLOT    unixplot
  97. X     V384        Vectrix 384 and tandy color printer
  98. X+    VTTEK       VT like Tektronix 4010 emulator
  99. X     X11         X11R4 window system
  100. X  
  101. X  
  102. X***************
  103. X*** 279,285
  104. X  
  105. X  under MSDOS:
  106. X  Using Microsoft C 5.10.
  107. X!     make makefile.msc
  108. X  
  109. X  Using Turbo C 2.0.
  110. X      make -fmakefile.tc
  111. X
  112. X--- 281,288 -----
  113. X  
  114. X  under MSDOS:
  115. X  Using Microsoft C 5.10.
  116. X!       copy makefile.msc
  117. X!       make makefile
  118. X  
  119. X  Using Turbo C 2.0.
  120. X        copy makefile.tc
  121. X***************
  122. X*** 282,288
  123. X      make makefile.msc
  124. X  
  125. X  Using Turbo C 2.0.
  126. X!     make -fmakefile.tc
  127. X  
  128. X  The file gnuplot.gih is needed for help on the PC.
  129. X  If the file gnuplot.gih is not in the default directory, then use:
  130. X
  131. X--- 285,293 -----
  132. X        make makefile
  133. X  
  134. X  Using Turbo C 2.0.
  135. X!       copy makefile.tc
  136. X!   Edit makefile to change TC, BIN, BGI.
  137. X!       make
  138. X  
  139. X  The file gnuplot.gih is needed for help on the PC.
  140. X  If the file gnuplot.gih is not in the default directory, then use:
  141. Xdiff -cr ./README.x11 ../gnuplot2.02/README.x11
  142. X*** ./README.x11    Tue Sep 18 14:56:39 1990
  143. X--- ../gnuplot2.02/README.x11    Mon Nov 26 02:31:27 1990
  144. X***************
  145. X*** 1,4
  146. X! Gnuplot Support for X11
  147. X  -----------------------
  148. X  31 August 1990
  149. X  
  150. X
  151. X--- 1,4 -----
  152. X! Gnuplot (patch 2) Support for X11
  153. X  -----------------------
  154. X  24 November 1990
  155. X  
  156. X***************
  157. X*** 1,6
  158. X  Gnuplot Support for X11
  159. X  -----------------------
  160. X! 31 August 1990
  161. X  
  162. X  Installing gnuplot X11 support requires:
  163. X  
  164. X
  165. X--- 1,6 -----
  166. X  Gnuplot (patch 2) Support for X11
  167. X  -----------------------
  168. X! 24 November 1990
  169. X  
  170. X  Installing gnuplot X11 support requires:
  171. X  
  172. X***************
  173. X*** 10,19
  174. X  
  175. X     o compilation of the outboard X11 terminal driver gnuplot_x11
  176. X  
  177. X-    o additions to the gnuplot(1) man page to describe command line
  178. X-      options and tailorable resources available when gnuplot terminal
  179. X-      types x11 or X11 are used.
  180. X- 
  181. X  makefile.x11 (a modified version of makefile.unx) provides these additional
  182. X  functions. The X11LIBS and X11INCLUDES parameters should be set to point to
  183. X  the X11 libraries and include files on your system. Comments give settings
  184. X
  185. X--- 10,15 -----
  186. X  
  187. X     o compilation of the outboard X11 terminal driver gnuplot_x11
  188. X  
  189. X  makefile.x11 (a modified version of makefile.unx) provides these additional
  190. X  functions. The X11LIBS and X11INCLUDES parameters should be set to point to
  191. X  the X11 libraries and include files on your system. Comments give settings
  192. X***************
  193. X*** 17,23
  194. X  makefile.x11 (a modified version of makefile.unx) provides these additional
  195. X  functions. The X11LIBS and X11INCLUDES parameters should be set to point to
  196. X  the X11 libraries and include files on your system. Comments give settings
  197. X! for several systems.
  198. X  
  199. X  Sorry, as of this writing no support is available for systems without the 
  200. X  Athena widget library (libXaw.a), or platforms other than unix.
  201. X
  202. X--- 13,20 -----
  203. X  makefile.x11 (a modified version of makefile.unx) provides these additional
  204. X  functions. The X11LIBS and X11INCLUDES parameters should be set to point to
  205. X  the X11 libraries and include files on your system. Comments give settings
  206. X! for several systems. The X11FLAGS parameter should be set to "-DMOTIF" to
  207. X! compile for the Motif (libXm.a) rather than Athena (libXaw.a) widget library.
  208. X  
  209. X  The gnuplot man page describes command line options and tailorable resources 
  210. X  available when gnuplot terminal types x11 or X11 are used.
  211. X***************
  212. X*** 19,26
  213. X  the X11 libraries and include files on your system. Comments give settings
  214. X  for several systems.
  215. X  
  216. X! Sorry, as of this writing no support is available for systems without the 
  217. X! Athena widget library (libXaw.a), or platforms other than unix.
  218. X  
  219. X  Differences from "xgnuplot"
  220. X  ---------------------------
  221. X
  222. X--- 16,23 -----
  223. X  for several systems. The X11FLAGS parameter should be set to "-DMOTIF" to
  224. X  compile for the Motif (libXm.a) rather than Athena (libXaw.a) widget library.
  225. X  
  226. X! The gnuplot man page describes command line options and tailorable resources 
  227. X! available when gnuplot terminal types x11 or X11 are used.
  228. X  
  229. X  Sorry, as of this writing no support is available for platforms other than unix.
  230. X  
  231. X***************
  232. X*** 22,27
  233. X  Sorry, as of this writing no support is available for systems without the 
  234. X  Athena widget library (libXaw.a), or platforms other than unix.
  235. X  
  236. X  Differences from "xgnuplot"
  237. X  ---------------------------
  238. X  
  239. X
  240. X--- 19,26 -----
  241. X  The gnuplot man page describes command line options and tailorable resources 
  242. X  available when gnuplot terminal types x11 or X11 are used.
  243. X  
  244. X+ Sorry, as of this writing no support is available for platforms other than unix.
  245. X+ 
  246. X  Differences from "xgnuplot"
  247. X  ---------------------------
  248. X  This X11 support is based on the xgnuplot wrapper/terminal driver distributed 
  249. X***************
  250. X*** 24,29
  251. X  
  252. X  Differences from "xgnuplot"
  253. X  ---------------------------
  254. X  
  255. X  This X11 support is based on (and replaces) the xgnuplot wrapper/terminal 
  256. X  driver which was distributed separately from gnuplot. Differences:
  257. X
  258. X--- 23,30 -----
  259. X  
  260. X  Differences from "xgnuplot"
  261. X  ---------------------------
  262. X+ This X11 support is based on the xgnuplot wrapper/terminal driver distributed 
  263. X+ separately from gnuplot. Differences:
  264. X  
  265. X     o Gnuplot silently invokes the outboard driver, rather than vice versa.
  266. X       Thus resource names in .Xdefaults begin with "gnuplot" rather than
  267. X***************
  268. X*** 25,33
  269. X  Differences from "xgnuplot"
  270. X  ---------------------------
  271. X  
  272. X- This X11 support is based on (and replaces) the xgnuplot wrapper/terminal 
  273. X- driver which was distributed separately from gnuplot. Differences:
  274. X- 
  275. X     o Gnuplot silently invokes the outboard driver, rather than vice versa.
  276. X       Thus resource names in .Xdefaults begin with "gnuplot" rather than
  277. X       "xgnuplot". En passant, this change fixed the bug where xgnuplot would
  278. X
  279. X--- 26,31 -----
  280. X  This X11 support is based on the xgnuplot wrapper/terminal driver distributed 
  281. X  separately from gnuplot. Differences:
  282. X  
  283. X     o Gnuplot silently invokes the outboard driver, rather than vice versa.
  284. X       Thus resource names in .Xdefaults begin with "gnuplot" rather than
  285. X       "xgnuplot".
  286. X***************
  287. X*** 30,38
  288. X  
  289. X     o Gnuplot silently invokes the outboard driver, rather than vice versa.
  290. X       Thus resource names in .Xdefaults begin with "gnuplot" rather than
  291. X!      "xgnuplot". En passant, this change fixed the bug where xgnuplot would
  292. X!      hang until Ctrl-C when gnuplot was exited without plotting at least
  293. X!      one x11/X11 plot.
  294. X  
  295. X     o When the window is resized, the currently displayed plot is automatically
  296. X       rescaled and replotted.
  297. X
  298. X--- 28,34 -----
  299. X  
  300. X     o Gnuplot silently invokes the outboard driver, rather than vice versa.
  301. X       Thus resource names in .Xdefaults begin with "gnuplot" rather than
  302. X!      "xgnuplot".
  303. X  
  304. X     o When the window is resized, the currently displayed plot is automatically
  305. X       rescaled and replotted.
  306. X***************
  307. X*** 37,48
  308. X     o When the window is resized, the currently displayed plot is automatically
  309. X       rescaled and replotted.
  310. X  
  311. X!    o Compiles under X11 R3 as well as R4. This required using XtInitialize
  312. X!      instead of XtAppInitialize, (char *) instead of XtPointer for callback
  313. X!      client data declarations, removing a reference to XGetGCValues, and 
  314. X!      parameterizing (X11INCLUDES in makefile.x11) the location of the needed 
  315. X!      Athena include files.
  316. X! 
  317. X  
  318. X  ---------------------------------
  319. X  Ed Kubaitis, ejk@uxh.cso.uiuc.edu
  320. X
  321. X--- 33,40 -----
  322. X     o When the window is resized, the currently displayed plot is automatically
  323. X       rescaled and replotted.
  324. X  
  325. X!    o Compiles under X11 R3 as well as R4 and with either the Athena or Motif 
  326. X!      widget libraries.
  327. X  
  328. X  ---------------------------------
  329. X  Ed Kubaitis, ejk@uxh.cso.uiuc.edu
  330. XCommon subdirectories: ./bugtest and ../gnuplot2.02/bugtest
  331. Xdiff -cr ./buildvms.com ../gnuplot2.02/buildvms.com
  332. X*** ./buildvms.com    Tue Sep 18 14:56:40 1990
  333. X--- ../gnuplot2.02/buildvms.com    Tue Dec  4 11:43:40 1990
  334. X***************
  335. X*** 3,8
  336. X  $ !TERMFLAGS = "/define=()"
  337. X  $ TERMFLAGS = ""
  338. X  $ set verify
  339. X  $ cc 'CFLAGS' command.c
  340. X  $ cc 'CFLAGS' eval.c
  341. X  $ cc 'CFLAGS' graphics.c
  342. X
  343. X--- 3,9 -----
  344. X  $ !TERMFLAGS = "/define=()"
  345. X  $ TERMFLAGS = ""
  346. X  $ set verify
  347. X+ $ cc 'CFLAGS' bitmap.c
  348. X  $ cc 'CFLAGS' command.c
  349. X  $ cc 'CFLAGS' eval.c
  350. X  $ cc 'CFLAGS' graphics.c
  351. X***************
  352. X*** 17,23
  353. X  $ cc 'CFLAGS' util.c
  354. X  $ cc 'CFLAGS' version.c
  355. X  $ link /exe=gnuplot -
  356. X!    command.obj,eval.obj,graphics.obj,internal.obj, -
  357. X     misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, -
  358. X     standard.obj,term.obj,util.obj,version.obj ,linkopt.vms/opt
  359. X  $ cc [.docs]doc2hlp.c
  360. X
  361. X--- 18,24 -----
  362. X  $ cc 'CFLAGS' util.c
  363. X  $ cc 'CFLAGS' version.c
  364. X  $ link /exe=gnuplot -
  365. X!    bitmap.obj,command.obj,eval.obj,graphics.obj,internal.obj, -
  366. X     misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, -
  367. X     standard.obj,term.obj,util.obj,version.obj ,linkopt.vms/opt
  368. X  $ cc [.docs]doc2hlp.c
  369. Xdiff -cr ./command.c ../gnuplot2.02/command.c
  370. X*** ./command.c    Tue Sep 18 14:56:42 1990
  371. X--- ../gnuplot2.02/command.c    Thu Nov 29 10:13:34 1990
  372. X***************
  373. X*** 75,81
  374. X  extern int strlen(), strcmp();
  375. X  
  376. X  #ifdef unix
  377. X! extern char *getwd();
  378. X  #else
  379. X  extern char *getcwd();
  380. X  #endif
  381. X
  382. X--- 75,82 -----
  383. X  extern int strlen(), strcmp();
  384. X  
  385. X  #ifdef unix
  386. X! #ifdef GETCWD
  387. X! extern char *getcwd();    /* some Unix's use getcwd */
  388. X  #else
  389. X  extern char *getwd();    /* most Unix's use getwd */
  390. X  #endif
  391. X***************
  392. X*** 77,83
  393. X  #ifdef unix
  394. X  extern char *getwd();
  395. X  #else
  396. X! extern char *getcwd();
  397. X  #endif
  398. X  extern int chdir();
  399. X  
  400. X
  401. X--- 78,84 -----
  402. X  #ifdef GETCWD
  403. X  extern char *getcwd();    /* some Unix's use getcwd */
  404. X  #else
  405. X! extern char *getwd();    /* most Unix's use getwd */
  406. X  #endif
  407. X  #else
  408. X  extern char *getcwd();    /* Turbo C, MSC and VMS use getcwd */
  409. X***************
  410. X*** 79,84
  411. X  #else
  412. X  extern char *getcwd();
  413. X  #endif
  414. X  extern int chdir();
  415. X  
  416. X  extern double magnitude(),angle(),real(),imag();
  417. X
  418. X--- 80,88 -----
  419. X  #else
  420. X  extern char *getwd();    /* most Unix's use getwd */
  421. X  #endif
  422. X+ #else
  423. X+ extern char *getcwd();    /* Turbo C, MSC and VMS use getcwd */
  424. X+ #endif
  425. X  extern int chdir();
  426. X  
  427. X  extern double magnitude(),angle(),real(),imag();
  428. X***************
  429. X*** 287,294
  430. X      }
  431. X      else if (almost_equals(c_token,"pwd")) {
  432. X  #ifdef unix
  433. X! /* unix has getwd() */
  434. X!       (void) getwd(sv_file);
  435. X  #else
  436. X  /* Turbo C and VMS have getcwd() */
  437. X        (void) getcwd(sv_file,MAX_ID_LEN);
  438. X
  439. X--- 291,298 -----
  440. X      }
  441. X      else if (almost_equals(c_token,"pwd")) {
  442. X  #ifdef unix
  443. X! #ifdef GETCWD
  444. X!       (void) getcwd(sv_file,MAX_ID_LEN); /* some Unix's use getcwd */
  445. X  #else
  446. X        (void) getwd(sv_file); /* most Unix's use getwd */
  447. X  #endif
  448. X***************
  449. X*** 290,295
  450. X  /* unix has getwd() */
  451. X        (void) getwd(sv_file);
  452. X  #else
  453. X  /* Turbo C and VMS have getcwd() */
  454. X        (void) getcwd(sv_file,MAX_ID_LEN);
  455. X  #endif
  456. X
  457. X--- 294,302 -----
  458. X  #ifdef GETCWD
  459. X        (void) getcwd(sv_file,MAX_ID_LEN); /* some Unix's use getcwd */
  460. X  #else
  461. X+       (void) getwd(sv_file); /* most Unix's use getwd */
  462. X+ #endif
  463. X+ #else
  464. X  /* Turbo C and VMS have getcwd() */
  465. X        (void) getcwd(sv_file,MAX_ID_LEN);
  466. X  #endif
  467. X***************
  468. X*** 328,333
  469. X  
  470. X  
  471. X  plotrequest()
  472. X  {
  473. X       BOOLEAN changed;
  474. X      int dummy_token = -1;
  475. X
  476. X--- 335,346 -----
  477. X  
  478. X  
  479. X  plotrequest()
  480. X+ /*
  481. X+    In the parametric case we can say 
  482. X+       plot [a= -4:4] [-2:2] [-1:1] sin(a),a**2
  483. X+    while in the non-parametric case we would say only
  484. X+       plot [b= -2:2] [-1:1] sin(b)
  485. X+ */
  486. X  {
  487. X       BOOLEAN changed;
  488. X      int dummy_token = -1;
  489. X***************
  490. X*** 332,337
  491. X       BOOLEAN changed;
  492. X      int dummy_token = -1;
  493. X  
  494. X       autoscale_lx = autoscale_x;
  495. X       autoscale_ly = autoscale_y;
  496. X      
  497. X
  498. X--- 345,351 -----
  499. X       BOOLEAN changed;
  500. X      int dummy_token = -1;
  501. X  
  502. X+     autoscale_lt = autoscale_t;
  503. X       autoscale_lx = autoscale_x;
  504. X       autoscale_ly = autoscale_y;
  505. X      
  506. X***************
  507. X*** 350,355
  508. X                 /* used to be: int_error("'=' expected",c_token); */
  509. X              }
  510. X          }
  511. X          changed = load_range(&xmin,&xmax);
  512. X          if (!equals(c_token,"]"))
  513. X              int_error("']' expected",c_token);
  514. X
  515. X--- 364,383 -----
  516. X                 /* used to be: int_error("'=' expected",c_token); */
  517. X              }
  518. X          }
  519. X+         changed = parametric ? load_range(&tmin,&tmax):load_range(&xmin,&xmax);
  520. X+         if (!equals(c_token,"]"))
  521. X+             int_error("']' expected",c_token);
  522. X+         c_token++;
  523. X+         if (changed) {
  524. X+             if (parametric)
  525. X+                 autoscale_lt = FALSE;
  526. X+             else
  527. X+                 autoscale_lx = FALSE;
  528. X+         }
  529. X+     }
  530. X+ 
  531. X+     if (parametric && equals(c_token,"[")) { /* set optional x ranges */
  532. X+         c_token++;
  533. X          changed = load_range(&xmin,&xmax);
  534. X          if (!equals(c_token,"]"))
  535. X              int_error("']' expected",c_token);
  536. X***************
  537. X*** 417,422
  538. X  register FILE *fp;
  539. X  float x, y;
  540. X  int npoints;                /* number of points and breaks read */
  541. X  
  542. X      quote_str(data_file, c_token);
  543. X      this_plot->plot_type = DATA;
  544. X
  545. X--- 445,453 -----
  546. X  register FILE *fp;
  547. X  float x, y;
  548. X  int npoints;                /* number of points and breaks read */
  549. X+ float temp;
  550. X+ BOOLEAN yfirst;
  551. X+ char format[MAX_LINE_LEN+1];
  552. X  
  553. X      quote_str(data_file, c_token);
  554. X      this_plot->plot_type = DATA;
  555. X***************
  556. X*** 423,428
  557. X      if ((fp = fopen(data_file, "r")) == (FILE *)NULL)
  558. X          os_error("can't open data file", c_token);
  559. X  
  560. X      l_num = 0;
  561. X       datum = 0;
  562. X      i = 0;
  563. X
  564. X--- 454,483 -----
  565. X      if ((fp = fopen(data_file, "r")) == (FILE *)NULL)
  566. X          os_error("can't open data file", c_token);
  567. X  
  568. X+     format[0] = '\0';
  569. X+     yfirst = FALSE;
  570. X+     c_token++;    /* skip data file name */
  571. X+     if (almost_equals(c_token,"u$sing")) {
  572. X+         c_token++;      /* skip "using" */
  573. X+         if (!isstring(c_token)) {
  574. X+             if ( equals(c_token,"xy") || equals(c_token,"y") )
  575. X+                 yfirst = FALSE;
  576. X+             else if (equals(c_token,"yx"))
  577. X+                 yfirst = TRUE;
  578. X+             else 
  579. X+                 int_error("expecting xy, yx, y or format (scanf) string",c_token);
  580. X+             c_token++;    /* skip "xy", "yx" or "y" */
  581. X+         }
  582. X+         if (isstring(c_token)) {
  583. X+             quotel_str(format, c_token);
  584. X+             c_token++;    /* skip format */
  585. X+         }
  586. X+         else
  587. X+             int_error("expecting format (scanf) string",c_token);
  588. X+     }
  589. X+     if (strlen(format) == 0)
  590. X+         strcpy(format,"%f %f");
  591. X+ 
  592. X      l_num = 0;
  593. X       datum = 0;
  594. X      i = 0;
  595. X***************
  596. X*** 441,447
  597. X              continue;
  598. X          }
  599. X  
  600. X!         switch (sscanf(line, "%f %f", &x, &y)) {
  601. X              case 1: {        /* only one number on the line */
  602. X                 y = x;        /* assign that number to y */
  603. X                 x = datum;    /* and make the index into x */
  604. X
  605. X--- 496,502 -----
  606. X              continue;
  607. X          }
  608. X  
  609. X!         switch (sscanf(line, format, &x, &y)) {
  610. X              case 1: {        /* only one number on the line */
  611. X                 y = x;        /* assign that number to y */
  612. X                 x = datum;    /* and make the index into x */
  613. X***************
  614. X*** 448,453
  615. X                 /* no break; !!! */
  616. X              }
  617. X              case 2: {
  618. X                 datum++;
  619. X                 this_plot->points[i].type = INRANGE;
  620. X  
  621. X
  622. X--- 503,513 -----
  623. X                 /* no break; !!! */
  624. X              }
  625. X              case 2: {
  626. X+                if (yfirst) { /* exchange x and y */
  627. X+                   temp = y;
  628. X+                   y = x;
  629. X+                   x = temp;
  630. X+                }
  631. X                 datum++;
  632. X                 this_plot->points[i].type = INRANGE;
  633. X  
  634. X***************
  635. X*** 517,523
  636. X  {
  637. X  register int i;
  638. X  register struct curve_points *this_plot, **tp_ptr;
  639. X! register int start_token, mysamples;
  640. X  register int begin_token;
  641. X  register double x_min, x_max, y_min, y_max, x;
  642. X  register double xdiff, temp;
  643. X
  644. X--- 577,583 -----
  645. X  {
  646. X  register int i;
  647. X  register struct curve_points *this_plot, **tp_ptr;
  648. X! register int start_token, end_token, mysamples;
  649. X  register int begin_token;
  650. X  double x_min, x_max, y_min, y_max;
  651. X  register double x, xdiff, temp;
  652. X***************
  653. X*** 519,526
  654. X  register struct curve_points *this_plot, **tp_ptr;
  655. X  register int start_token, mysamples;
  656. X  register int begin_token;
  657. X! register double x_min, x_max, y_min, y_max, x;
  658. X! register double xdiff, temp;
  659. X  static struct value a;
  660. X  BOOLEAN some_data_files = FALSE;
  661. X  int plot_num, line_num, point_num;
  662. X
  663. X--- 579,586 -----
  664. X  register struct curve_points *this_plot, **tp_ptr;
  665. X  register int start_token, end_token, mysamples;
  666. X  register int begin_token;
  667. X! double x_min, x_max, y_min, y_max;
  668. X! register double x, xdiff, temp;
  669. X  static struct value a;
  670. X  BOOLEAN ltmp, some_data_files = FALSE;
  671. X  int plot_num, line_num, point_num, xparam=0;
  672. X***************
  673. X*** 522,529
  674. X  register double x_min, x_max, y_min, y_max, x;
  675. X  register double xdiff, temp;
  676. X  static struct value a;
  677. X! BOOLEAN some_data_files = FALSE;
  678. X! int plot_num, line_num, point_num;
  679. X  
  680. X      mysamples = samples;
  681. X  
  682. X
  683. X--- 582,591 -----
  684. X  double x_min, x_max, y_min, y_max;
  685. X  register double x, xdiff, temp;
  686. X  static struct value a;
  687. X! BOOLEAN ltmp, some_data_files = FALSE;
  688. X! int plot_num, line_num, point_num, xparam=0;
  689. X! char *xtitle;
  690. X! void parametric_fixup();
  691. X  
  692. X      mysamples = samples;
  693. X  
  694. X***************
  695. X*** 569,574
  696. X              }
  697. X  
  698. X              if (isstring(c_token)) {            /* data file to plot */
  699. X                  if (!some_data_files && autoscale_lx) {
  700. X                      xmin = VERYLARGE;
  701. X                      xmax = -VERYLARGE;
  702. X
  703. X--- 631,640 -----
  704. X              }
  705. X  
  706. X              if (isstring(c_token)) {            /* data file to plot */
  707. X+                 if (parametric && xparam) 
  708. X+                     int_error("previous parametric function not fully specified",
  709. X+                                                                     c_token);
  710. X+ 
  711. X                  if (!some_data_files && autoscale_lx) {
  712. X                      xmin = VERYLARGE;
  713. X                      xmax = -VERYLARGE;
  714. X***************
  715. X*** 577,584
  716. X  
  717. X                  this_plot->plot_type = DATA;
  718. X                  this_plot->plot_style = data_style;
  719. X!                 get_data(this_plot);
  720. X!                 c_token++;
  721. X              } 
  722. X              else {                            /* function to plot */
  723. X                  this_plot->plot_type = FUNC;
  724. X
  725. X--- 643,650 -----
  726. X  
  727. X                  this_plot->plot_type = DATA;
  728. X                  this_plot->plot_style = data_style;
  729. X!                 end_token = c_token;
  730. X!                 get_data(this_plot); /* this also parses the using option */
  731. X              } 
  732. X              else {                            /* function to plot */
  733. X                  if (parametric)            /* working on x parametric function */
  734. X***************
  735. X*** 581,586
  736. X                  c_token++;
  737. X              } 
  738. X              else {                            /* function to plot */
  739. X                  this_plot->plot_type = FUNC;
  740. X                  this_plot->plot_style = func_style;
  741. X                  dummy_func = &plot_func;
  742. X
  743. X--- 647,654 -----
  744. X                  get_data(this_plot); /* this also parses the using option */
  745. X              } 
  746. X              else {                            /* function to plot */
  747. X+                 if (parametric)            /* working on x parametric function */
  748. X+                     xparam = 1 - xparam;
  749. X                  this_plot->plot_type = FUNC;
  750. X                  this_plot->plot_style = func_style;
  751. X                  dummy_func = &plot_func;
  752. X***************
  753. X*** 586,591
  754. X                  dummy_func = &plot_func;
  755. X                  plot_func.at = temp_at();
  756. X                  /* ignore it for now */
  757. X              }
  758. X  
  759. X              if (almost_equals(c_token,"t$itle")) {
  760. X
  761. X--- 654,660 -----
  762. X                  dummy_func = &plot_func;
  763. X                  plot_func.at = temp_at();
  764. X                  /* ignore it for now */
  765. X+                 end_token = c_token-1;
  766. X              }
  767. X  
  768. X              if (almost_equals(c_token,"t$itle")) {
  769. X***************
  770. X*** 589,594
  771. X              }
  772. X  
  773. X              if (almost_equals(c_token,"t$itle")) {
  774. X                  c_token++;
  775. X                  if ( (input_line[token[c_token].start_index]=='\'')
  776. X                     ||(input_line[token[c_token].start_index]=='"') ) {
  777. X
  778. X--- 658,671 -----
  779. X              }
  780. X  
  781. X              if (almost_equals(c_token,"t$itle")) {
  782. X+                 if (parametric) {
  783. X+                     if (xparam) 
  784. X+                         int_error(
  785. X+         "\"title\" allowed only after parametric function fully specified",
  786. X+                                                                     c_token);
  787. X+                     else if (xtitle != NULL)
  788. X+                         xtitle[0] = '\0';  /* Remove default title .*/
  789. X+                 }
  790. X                  c_token++;
  791. X                  if ( (input_line[token[c_token].start_index]=='\'')
  792. X                     ||(input_line[token[c_token].start_index]=='"') ) {
  793. X***************
  794. X*** 599,609
  795. X                  }
  796. X                  c_token++;
  797. X              }
  798. X!             else {
  799. X!                 m_capture(&(this_plot->title),start_token,c_token-1);
  800. X!             }
  801. X! 
  802. X!             this_plot->line_type = line_num;
  803. X              this_plot->point_type = point_num;
  804. X  
  805. X              if (almost_equals(c_token,"w$ith")) {
  806. X
  807. X--- 676,687 -----
  808. X                  }
  809. X                  c_token++;
  810. X              }
  811. X!               else {
  812. X!                   m_capture(&(this_plot->title),start_token,end_token);
  813. X!                  if (xparam) xtitle = this_plot->title;
  814. X!               }
  815. X!   
  816. X!               this_plot->line_type = line_num;
  817. X              this_plot->point_type = point_num;
  818. X  
  819. X              if (almost_equals(c_token,"w$ith")) {
  820. X***************
  821. X*** 607,612
  822. X              this_plot->point_type = point_num;
  823. X  
  824. X              if (almost_equals(c_token,"w$ith")) {
  825. X                  this_plot->plot_style = get_style();
  826. X              }
  827. X  
  828. X
  829. X--- 685,693 -----
  830. X              this_plot->point_type = point_num;
  831. X  
  832. X              if (almost_equals(c_token,"w$ith")) {
  833. X+                 if (parametric && xparam) 
  834. X+                     int_error("\"with\" allowed only after parametric function fully specified",
  835. X+                                                                     c_token);
  836. X                  this_plot->plot_style = get_style();
  837. X              }
  838. X  
  839. X***************
  840. X*** 620,627
  841. X              }
  842. X              if ( (this_plot->plot_style == POINTS) ||
  843. X                   (this_plot->plot_style == LINESPOINTS) )
  844. X!                     point_num++;
  845. X!             line_num++;
  846. X  
  847. X              tp_ptr = &(this_plot->next_cp);
  848. X          }
  849. X
  850. X--- 701,708 -----
  851. X              }
  852. X              if ( (this_plot->plot_style == POINTS) ||
  853. X                   (this_plot->plot_style == LINESPOINTS) )
  854. X!                     if (!xparam) point_num++;
  855. X!             if (!xparam) line_num++;
  856. X  
  857. X              tp_ptr = &(this_plot->next_cp);
  858. X          }
  859. X***************
  860. X*** 632,637
  861. X              break;
  862. X      }
  863. X  
  864. X  /*** Second Pass: Evaluate the functions ***/
  865. X  /* Everything is defined now, except the function data. We expect
  866. X   * no syntax errors, etc, since the above parsed it all. This makes 
  867. X
  868. X--- 713,728 -----
  869. X              break;
  870. X      }
  871. X  
  872. X+     if (parametric && xparam) 
  873. X+         int_error("parametric function not fully specified", NO_CARET);
  874. X+ 
  875. X+     if (parametric) {
  876. X+     /* Swap t and x ranges for duration of these eval_plot computations. */
  877. X+         ltmp = autoscale_lx; autoscale_lx = autoscale_lt; autoscale_lt = ltmp;
  878. X+         temp = xmin; xmin = tmin; tmin = temp;
  879. X+         temp = xmax; xmax = tmax; tmax = temp;
  880. X+     }
  881. X+ 
  882. X  /*** Second Pass: Evaluate the functions ***/
  883. X  /* Everything is defined now, except the function data. We expect
  884. X   * no syntax errors, etc, since the above parsed it all. This makes 
  885. X***************
  886. X*** 639,645
  887. X   */
  888. X       if (xmin == xmax)
  889. X        if (autoscale_lx) {
  890. X!          fprintf(stderr, "Warning: empty x range [%g:%g], ", xmin,xmax);
  891. X           if (xmin == 0.0) {
  892. X              /* completely arbitary */
  893. X              xmin = -1.;
  894. X
  895. X--- 730,737 -----
  896. X   */
  897. X       if (xmin == xmax)
  898. X        if (autoscale_lx) {
  899. X!          fprintf(stderr, "Warning: empty %c range [%g:%g], ", 
  900. X!             parametric ? 't' : 'x', xmin,xmax);
  901. X           if (xmin == 0.0) {
  902. X              /* completely arbitary */
  903. X              xmin = -1.;
  904. X***************
  905. X*** 654,659
  906. X           int_error("x range is empty", c_token);
  907. X        }
  908. X  
  909. X      if (log_x) {
  910. X         if (xmin <= 0.0 || xmax <= 0.0)
  911. X          int_error("x range must be greater than 0 for log scale!",NO_CARET);
  912. X
  913. X--- 746,756 -----
  914. X           int_error("x range is empty", c_token);
  915. X        }
  916. X  
  917. X+     /* give error if xrange badly set from missing datafile error */
  918. X+     if (xmin == VERYLARGE || xmax == -VERYLARGE) {
  919. X+         int_error("x range is invalid", c_token);
  920. X+     }
  921. X+ 
  922. X      if (log_x) {
  923. X         if (xmin <= 0.0 || xmax <= 0.0)
  924. X          int_error("x range must be greater than 0 for log scale!",NO_CARET);
  925. X***************
  926. X*** 679,684
  927. X              if (isstring(c_token)) {            /* data file to plot */
  928. X                  /* ignore this now */
  929. X                  c_token++;
  930. X              } 
  931. X              else {                            /* function to plot */
  932. X                  dummy_func = &plot_func;
  933. X
  934. X--- 776,787 -----
  935. X              if (isstring(c_token)) {            /* data file to plot */
  936. X                  /* ignore this now */
  937. X                  c_token++;
  938. X+                 if (almost_equals(c_token,"u$sing")) {
  939. X+                     c_token++;      /* skip "using" */
  940. X+                     if (!isstring(c_token))
  941. X+                         c_token++;    /* skip "xy", "yx" or "y" */
  942. X+                     c_token++;        /* skip format string */
  943. X+                 }
  944. X              } 
  945. X              else {                            /* function to plot */
  946. X                  if (parametric)            /* working on x parametric function */
  947. X***************
  948. X*** 681,686
  949. X                  c_token++;
  950. X              } 
  951. X              else {                            /* function to plot */
  952. X                  dummy_func = &plot_func;
  953. X                  plot_func.at = temp_at(); /* reparse function */
  954. X      
  955. X
  956. X--- 784,791 -----
  957. X                  }
  958. X              } 
  959. X              else {                            /* function to plot */
  960. X+                 if (parametric)            /* working on x parametric function */
  961. X+                     xparam = 1 - xparam;
  962. X                  dummy_func = &plot_func;
  963. X                  plot_func.at = temp_at(); /* reparse function */
  964. X      
  965. X***************
  966. X*** 724,731
  967. X                      if (autoscale_ly || polar
  968. X                         || inrange(temp, ymin, ymax)) {
  969. X                         this_plot->points[i].type = INRANGE;
  970. X!                        if (autoscale_ly && temp < ymin) ymin = temp;
  971. X!                        if (autoscale_ly && temp > ymax) ymax = temp;
  972. X                      } else
  973. X                       this_plot->points[i].type = OUTRANGE;
  974. X                  }
  975. X
  976. X--- 829,839 -----
  977. X                      if (autoscale_ly || polar
  978. X                         || inrange(temp, ymin, ymax)) {
  979. X                         this_plot->points[i].type = INRANGE;
  980. X!                     /* When xparam is 1 we are not really computing y's! */
  981. X!                         if (!xparam && autoscale_ly) {
  982. X!                            if (temp < ymin) ymin = temp;
  983. X!                            if (temp > ymax) ymax = temp;
  984. X!                         }
  985. X                      } else
  986. X                       this_plot->points[i].type = OUTRANGE;
  987. X                  }
  988. X***************
  989. X*** 789,794
  990. X          y_max = ymax;
  991. X      }
  992. X      capture(replot_line,plot_token,c_token);    
  993. X      do_plot(first_plot,plot_num,x_min,x_max,y_min,y_max);
  994. X  }
  995. X  
  996. X
  997. X--- 897,918 -----
  998. X          y_max = ymax;
  999. X      }
  1000. X      capture(replot_line,plot_token,c_token);    
  1001. X+ 
  1002. X+     if (parametric) {
  1003. X+     /* Now put t and x ranges back before we actually plot anything. */
  1004. X+         ltmp = autoscale_lx; autoscale_lx = autoscale_lt; autoscale_lt = ltmp;
  1005. X+         temp = xmin; xmin = tmin; tmin = temp;
  1006. X+         temp = xmax; xmax = tmax; tmax = temp;
  1007. X+         if (some_data_files && autoscale_lx) {
  1008. X+         /* 
  1009. X+             Stop any further autoscaling in this case (may be a mistake, have
  1010. X+               to consider what is really wanted some day in the future--jdc). 
  1011. X+         */
  1012. X+             autoscale_lx = 0;
  1013. X+         }
  1014. X+     /* Now actually fix the plot pairs to be single plots. */
  1015. X+         parametric_fixup (first_plot, &plot_num, &x_min, &x_max);
  1016. X+     }
  1017. X      do_plot(first_plot,plot_num,x_min,x_max,y_min,y_max);
  1018. X  }
  1019. X  
  1020. X***************
  1021. X*** 804,809
  1022. X  #endif
  1023. X      exit(status);
  1024. X  }
  1025. X  
  1026. X  #ifdef MSDOS
  1027. X  #ifndef __TURBOC__    /* Turbo C already has sleep() */
  1028. X
  1029. X--- 928,1074 -----
  1030. X  #endif
  1031. X      exit(status);
  1032. X  }
  1033. X+ 
  1034. X+ void parametric_fixup (start_plot, plot_num, x_min, x_max)
  1035. X+ struct curve_points *start_plot;
  1036. X+ int *plot_num;
  1037. X+ double *x_min, *x_max;
  1038. X+ /*
  1039. X+     The hardest part of this routine is collapsing the FUNC plot types
  1040. X+    in the list (which are gauranteed to occur in (x,y) pairs while 
  1041. X+     preserving the non-FUNC type plots intact.  This means we have to
  1042. X+     work our way through various lists.  Examples (hand checked):
  1043. X+         start_plot:F1->F2->NULL ==> F2->NULL
  1044. X+         start_plot:F1->F2->F3->F4->F5->F6->NULL ==> F2->F4->F6->NULL
  1045. X+         start_plot:F1->F2->D1->D2->F3->F4->D3->NULL ==> F2->D1->D2->F4->D3->NULL
  1046. X+     
  1047. X+     Of course, the more interesting work is to move the y values of
  1048. X+     the x function to become the x values of the y function (checking
  1049. X+     the mins and maxs as we go along).
  1050. X+ */
  1051. X+ {
  1052. X+     struct curve_points *xp, *new_list, *yp = start_plot, *tmp, 
  1053. X+             *free_list, *free_head=NULL;
  1054. X+     int i, tlen, curve; 
  1055. X+     char *new_title;
  1056. X+     double lxmin, lxmax, temp;
  1057. X+ 
  1058. X+     if (autoscale_lx) {
  1059. X+         lxmin = VERYLARGE;
  1060. X+         lxmax = -VERYLARGE;
  1061. X+     } else {
  1062. X+         lxmin = xmin;
  1063. X+         lxmax = xmax;
  1064. X+     }
  1065. X+ 
  1066. X+ /* 
  1067. X+     Ok, go through all the plots and move FUNC types together.  Note: this
  1068. X+     originally was written to look for a NULL next pointer, but gnuplot 
  1069. X+     wants to be sticky in grabbing memory and the right number of items
  1070. X+     in the plot list is controlled by the plot_num variable.
  1071. X+ 
  1072. X+     Since gnuplot wants to do this sticky business, a free_list of 
  1073. X+     curve_points is kept and then tagged onto the end of the plot list as
  1074. X+     this seems more in the spirit of the original memory behavior than
  1075. X+     simply freeing the memory.  I'm personally not convinced this sort
  1076. X+     of concern is worth it since the time spent computing points seems
  1077. X+     to dominate any garbage collecting that might be saved here...
  1078. X+ */
  1079. X+     new_list = xp = start_plot; 
  1080. X+     yp = xp->next_cp;
  1081. X+    curve = 0;
  1082. X+     for (; curve < *plot_num; xp = xp->next_cp,yp = yp->next_cp,curve++) {
  1083. X+         if (xp->plot_type != FUNC) {
  1084. X+             continue;
  1085. X+         }
  1086. X+     /* Here's a FUNC parametric function defined as two parts. */
  1087. X+         --(*plot_num);
  1088. X+     /* 
  1089. X+         Go through all the points assigning the y's from xp to be the
  1090. X+         x's for yp.  Check max's and min's as you go.
  1091. X+     */
  1092. X+         for (i = 0; i < yp->p_count; ++i) {
  1093. X+         /* 
  1094. X+             Throw away excess xp points, mark excess yp points as OUTRANGE.
  1095. X+         */
  1096. X+             if (i > xp->p_count) {
  1097. X+                 yp->points[i].type == OUTRANGE;
  1098. X+                 continue;
  1099. X+             }
  1100. X+         /* 
  1101. X+             Just as we had to do when we computed y values--now check that
  1102. X+             x's (computed parametrically) are in the permitted ranges as well.
  1103. X+         */
  1104. X+             temp = xp->points[i].y;   /* New x value for yp function. */
  1105. X+             yp->points[i].x = temp;
  1106. X+         /* For legitimate y values, let the x values decide if they plot. */
  1107. X+             if (yp->points[i].type == INRANGE)
  1108. X+                 yp->points[i].type = xp->points[i].type;  
  1109. X+             if (autoscale_lx || polar
  1110. X+                        || inrange(temp, lxmin, lxmax)) {
  1111. X+                if (autoscale_lx && temp < lxmin) lxmin = temp;
  1112. X+                 if (autoscale_lx && temp > lxmax) lxmax = temp;
  1113. X+             } else
  1114. X+             yp->points[i].type = OUTRANGE;  /* Due to x value. */
  1115. X+         }
  1116. X+    /* Ok, fix up the title to include both the xp and yp plots. */
  1117. X+         if (xp->title && xp->title[0] != '\0') {
  1118. X+             tlen = strlen (yp->title) + strlen (xp->title) + 3;
  1119. X+           new_title = alloc ((unsigned int) tlen, "string");
  1120. X+             strcpy (new_title, xp->title);  
  1121. X+             strcat (new_title, ", ");       /* + 2 */
  1122. X+             strcat (new_title, yp->title);  /* + 1 = + 3 */
  1123. X+             free (yp->title);
  1124. X+             yp->title = new_title;
  1125. X+         }
  1126. X+     /* Eliminate the first curve (xparam) and just use the second. */
  1127. X+         if (xp == start_plot) {
  1128. X+         /* Simply nip off the first element of the list. */
  1129. X+             new_list = first_plot = yp;
  1130. X+             xp = xp->next_cp;
  1131. X+             if (yp->next_cp != NULL)
  1132. X+                 yp = yp->next_cp;
  1133. X+         /* Add start_plot to the free_list. */
  1134. X+             if (free_head == NULL) {
  1135. X+                 free_list = free_head = start_plot;
  1136. X+                 free_head->next_cp = NULL;
  1137. X+             } else {
  1138. X+                 free_list->next_cp = start_plot;
  1139. X+                 start_plot->next_cp = NULL;
  1140. X+                 free_list = start_plot;
  1141. X+             }
  1142. X+         }
  1143. X+         else {
  1144. X+         /* Here, remove the xp node and replace it with the yp node. */
  1145. X+            tmp = xp;
  1146. X+         /* Pass over any data files that might have been in place. */
  1147. X+             while (new_list->next_cp && new_list->next_cp != xp) 
  1148. X+                 new_list = new_list->next_cp;
  1149. X+             new_list->next_cp = yp;
  1150. X+             new_list = new_list->next_cp;
  1151. X+             xp = xp->next_cp;
  1152. X+             if (yp->next_cp != NULL)
  1153. X+                 yp = yp->next_cp;
  1154. X+         /* Add tmp to the free_list. */
  1155. X+             if (free_head == NULL) {
  1156. X+                 free_list = free_head = tmp;
  1157. X+             } else {
  1158. X+                 free_list->next_cp = tmp;
  1159. X+                 tmp->next_cp = NULL;
  1160. X+                 free_list = tmp;
  1161. X+             }
  1162. X+         }
  1163. X+     }
  1164. X+ /* Ok, stick the free list at the end of the curve_points plot list. */
  1165. X+     while (new_list->next_cp != NULL)
  1166. X+         new_list = new_list->next_cp;
  1167. X+     new_list->next_cp = free_head;
  1168. X+ 
  1169. X+ /* Report the overall graph mins and maxs. */
  1170. X+     *x_min = lxmin;
  1171. X+     *x_max = lxmax;
  1172. X+ }
  1173. X+ 
  1174. X  
  1175. X  #ifdef MSDOS
  1176. X  #ifndef __TURBOC__    /* Turbo C already has sleep() */
  1177. XCommon subdirectories: ./demo and ../gnuplot2.02/demo
  1178. XCommon subdirectories: ./docs and ../gnuplot2.02/docs
  1179. XOnly in .: gnuplot
  1180. Xdiff -cr ./gnuplot_x11.c ../gnuplot2.02/gnuplot_x11.c
  1181. X*** ./gnuplot_x11.c    Tue Sep 18 14:59:27 1990
  1182. X--- ../gnuplot2.02/gnuplot_x11.c    Wed Nov 28 09:34:33 1990
  1183. X***************
  1184. X*** 1,5
  1185. X  /*-----------------------------------------------------------------------------
  1186. X-  *
  1187. X   *   gnuplot_x11 - X11 outboard terminal driver for gnuplot 2
  1188. X   *
  1189. X   *   Requires installation of companion inboard x11 driver in gnuplot/term.c
  1190. X
  1191. X--- 1,4 -----
  1192. X  /*-----------------------------------------------------------------------------
  1193. X   *   gnuplot_x11 - X11 outboard terminal driver for gnuplot 2
  1194. X   *
  1195. X   *   Requires installation of companion inboard x11 driver in gnuplot/term.c
  1196. X***************
  1197. X*** 8,13
  1198. X   *      Chris Peterson (MIT) - original Xlib gnuplot support (and Xaw examples)
  1199. X   *      Dana Chee (Bellcore)  - mods to original support for gnuplot 2.0
  1200. X   *      Arthur Smith (Cornell) - graphical-label-widget idea (xplot)
  1201. X   *
  1202. X   *   This code is provided as is and with no warranties of any kind.
  1203. X   *       
  1204. X
  1205. X--- 7,13 -----
  1206. X   *      Chris Peterson (MIT) - original Xlib gnuplot support (and Xaw examples)
  1207. X   *      Dana Chee (Bellcore)  - mods to original support for gnuplot 2.0
  1208. X   *      Arthur Smith (Cornell) - graphical-label-widget idea (xplot)
  1209. X+  *      Hendri Hondorp (University of Twente, The Netherlands) - Motif xgnuplot
  1210. X   *
  1211. X   *   This code is provided as is and with no warranties of any kind.
  1212. X   *       
  1213. X***************
  1214. X*** 11,18
  1215. X   *
  1216. X   *   This code is provided as is and with no warranties of any kind.
  1217. X   *       
  1218. X!  *   Ed Kubaitis
  1219. X!  *   Computing Services Office -  University of Illinois, Urbana
  1220. X   *---------------------------------------------------------------------------*/
  1221. X   
  1222. X  #include <stdio.h>
  1223. X
  1224. X--- 11,17 -----
  1225. X   *
  1226. X   *   This code is provided as is and with no warranties of any kind.
  1227. X   *       
  1228. X!  *   Ed Kubaitis - Computing Services Office -  University of Illinois, Urbana
  1229. X   *---------------------------------------------------------------------------*/
  1230. X   
  1231. X  #include <stdio.h>
  1232. X***************
  1233. X*** 16,21
  1234. X   *---------------------------------------------------------------------------*/
  1235. X   
  1236. X  #include <stdio.h>
  1237. X  #include <X11/Intrinsic.h>
  1238. X  #include <X11/StringDefs.h>
  1239. X  #include <Cardinals.h>      /* use -Idir for location on your system */
  1240. X
  1241. X--- 15,21 -----
  1242. X   *---------------------------------------------------------------------------*/
  1243. X   
  1244. X  #include <stdio.h>
  1245. X+ #include <signal.h>
  1246. X  #include <X11/Intrinsic.h>
  1247. X  #include <X11/StringDefs.h>
  1248. X  #include <Label.h>          /* use -Idir for location on your system */
  1249. X***************
  1250. X*** 18,24
  1251. X  #include <stdio.h>
  1252. X  #include <X11/Intrinsic.h>
  1253. X  #include <X11/StringDefs.h>
  1254. X- #include <Cardinals.h>      /* use -Idir for location on your system */
  1255. X  #include <Label.h>          /* use -Idir for location on your system */
  1256. X  
  1257. X  
  1258. X
  1259. X--- 18,23 -----
  1260. X  #include <signal.h>
  1261. X  #include <X11/Intrinsic.h>
  1262. X  #include <X11/StringDefs.h>
  1263. X  #include <Label.h>          /* use -Idir for location on your system */
  1264. X  #ifdef MOTIF
  1265. X  #include <Xm.h>             /* use -Idir for location on your system */
  1266. X***************
  1267. X*** 20,25
  1268. X  #include <X11/StringDefs.h>
  1269. X  #include <Cardinals.h>      /* use -Idir for location on your system */
  1270. X  #include <Label.h>          /* use -Idir for location on your system */
  1271. X  
  1272. X  
  1273. X  #define Color (D>1)
  1274. X
  1275. X--- 19,32 -----
  1276. X  #include <X11/Intrinsic.h>
  1277. X  #include <X11/StringDefs.h>
  1278. X  #include <Label.h>          /* use -Idir for location on your system */
  1279. X+ #ifdef MOTIF
  1280. X+ #include <Xm.h>             /* use -Idir for location on your system */
  1281. X+ #define LabelWC xmLabelWidgetClass
  1282. X+ #define LabelBPM XmNbackgroundPixmap
  1283. X+ #else
  1284. X+ #define LabelWC labelWidgetClass
  1285. X+ #define LabelBPM XtNbitmap
  1286. X+ #endif
  1287. X  
  1288. X  #define Color (D>1)
  1289. X  #define Ncolors 11
  1290. X***************
  1291. X*** 21,27
  1292. X  #include <Cardinals.h>      /* use -Idir for location on your system */
  1293. X  #include <Label.h>          /* use -Idir for location on your system */
  1294. X  
  1295. X- 
  1296. X  #define Color (D>1)
  1297. X  #define Ncolors 11
  1298. X  unsigned long colors[Ncolors];
  1299. X
  1300. X--- 28,33 -----
  1301. X  #define LabelBPM XtNbitmap
  1302. X  #endif
  1303. X  
  1304. X  #define Color (D>1)
  1305. X  #define Ncolors 11
  1306. X  unsigned long colors[Ncolors];
  1307. X***************
  1308. X*** 27,33
  1309. X  unsigned long colors[Ncolors];
  1310. X  char color_keys[Ncolors][30] =   { "text", "border", "axis", 
  1311. X     "line1", "line2", "line3", "line4", "line5", "line6", "line7", "line8" };
  1312. X- 
  1313. X  char color_values[Ncolors][30] = { "black", "black", "black", 
  1314. X     "red",  "green", "blue",  "magenta", "cyan", "sienna", "orange", "coral" };
  1315. X  
  1316. X
  1317. X--- 33,38 -----
  1318. X  unsigned long colors[Ncolors];
  1319. X  char color_keys[Ncolors][30] =   { "text", "border", "axis", 
  1320. X     "line1", "line2", "line3", "line4", "line5", "line6", "line7", "line8" };
  1321. X  char color_values[Ncolors][30] = { "black", "black", "black", 
  1322. X     "red",  "green", "blue",  "magenta", "cyan", "sienna", "orange", "coral" };
  1323. X  
  1324. X***************
  1325. X*** 35,42
  1326. X     {0}, {4,2,0}, {1,3,0}, {4,4,0}, {1,5,0}, {4,4,4,1,0}, {4,2,0}, {1,3,0}
  1327. X     };
  1328. X  
  1329. X! Widget w_top, w_label;
  1330. X! Window win;  Display *dpy;
  1331. X  Pixmap pixmap;  GC gc = (GC)NULL;
  1332. X  XFontStruct *font;
  1333. X  unsigned long fg, bg;
  1334. X
  1335. X--- 40,46 -----
  1336. X     {0}, {4,2,0}, {1,3,0}, {4,4,0}, {1,5,0}, {4,4,4,1,0}, {4,2,0}, {1,3,0}
  1337. X     };
  1338. X  
  1339. X! Widget w_top, w_label; Window win; Display *dpy;
  1340. X  Pixmap pixmap;  GC gc = (GC)NULL;
  1341. X  Dimension W = 640 , H = 450;  int D;
  1342. X  Arg args[5];
  1343. X***************
  1344. X*** 38,45
  1345. X  Widget w_top, w_label;
  1346. X  Window win;  Display *dpy;
  1347. X  Pixmap pixmap;  GC gc = (GC)NULL;
  1348. X- XFontStruct *font;
  1349. X- unsigned long fg, bg;
  1350. X  Dimension W = 640 , H = 450;  int D;
  1351. X  Arg args[5];
  1352. X  static void gnuplot(), resize();
  1353. X
  1354. X--- 42,47 -----
  1355. X  
  1356. X  Widget w_top, w_label; Window win; Display *dpy;
  1357. X  Pixmap pixmap;  GC gc = (GC)NULL;
  1358. X  Dimension W = 640 , H = 450;  int D;
  1359. X  Arg args[5];
  1360. X  static void gnuplot(), resize();
  1361. X***************
  1362. X*** 53,58
  1363. X  char buf[Nbuf];
  1364. X  String *commands = NULL;
  1365. X  
  1366. X  /*-----------------------------------------------------------------------------
  1367. X   *   main program - fire up application and callbacks
  1368. X   *---------------------------------------------------------------------------*/
  1369. X
  1370. X--- 55,76 -----
  1371. X  char buf[Nbuf];
  1372. X  String *commands = NULL;
  1373. X  
  1374. X+ typedef struct {       /* See "X Toolkit Intrinsics Programming Manual"      */
  1375. X+   XFontStruct *font;   /* Nye and O'Reilly, O'Reilly & Associates, pp. 80-85 */
  1376. X+   unsigned long fg;
  1377. X+   unsigned long bg;
  1378. X+   } RValues, *RVptr; 
  1379. X+ RValues rv;
  1380. X+ 
  1381. X+ XtResource resources[] = {
  1382. X+    { XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), 
  1383. X+      XtOffset(RVptr, font), XtRString, "fixed" },
  1384. X+    { XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), 
  1385. X+      XtOffset(RVptr, fg), XtRString, XtDefaultForeground },
  1386. X+    { XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel), 
  1387. X+      XtOffset(RVptr, bg), XtRString, XtDefaultBackground },
  1388. X+    };
  1389. X+ 
  1390. X  /*-----------------------------------------------------------------------------
  1391. X   *   main program - fire up application and callbacks
  1392. X   *---------------------------------------------------------------------------*/
  1393. X***************
  1394. X*** 59,64
  1395. X  
  1396. X  main(argc, argv) int argc; char *argv[]; {
  1397. X  
  1398. X     /* initialize application */
  1399. X     w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
  1400. X     XtSetArg(args[0], XtNwidth, W);
  1401. X
  1402. X--- 77,85 -----
  1403. X  
  1404. X  main(argc, argv) int argc; char *argv[]; {
  1405. X  
  1406. X+    signal(SIGINT, SIG_IGN);
  1407. X+    signal(SIGTSTP, SIG_IGN);
  1408. X+ 
  1409. X     /* initialize application */
  1410. X     w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
  1411. X     XtSetArg(args[0], XtNwidth, W);
  1412. X***************
  1413. X*** 63,69
  1414. X     w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
  1415. X     XtSetArg(args[0], XtNwidth, W);
  1416. X     XtSetArg(args[1], XtNheight, H);
  1417. X!    w_label = XtCreateManagedWidget("", labelWidgetClass, w_top, args, TWO);
  1418. X     XtRealizeWidget(w_top);
  1419. X  
  1420. X     /* extract needed information */
  1421. X
  1422. X--- 84,90 -----
  1423. X     w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
  1424. X     XtSetArg(args[0], XtNwidth, W);
  1425. X     XtSetArg(args[1], XtNheight, H);
  1426. X!    w_label = XtCreateManagedWidget ("", LabelWC, w_top, args, (Cardinal)2);
  1427. X     XtRealizeWidget(w_top);
  1428. X  
  1429. X     /* extract needed information */
  1430. X***************
  1431. X*** 67,73
  1432. X     XtRealizeWidget(w_top);
  1433. X  
  1434. X     /* extract needed information */
  1435. X!    dpy = XtDisplay(w_top); win = XtWindow(w_top); D = DisplayPlanes(dpy,0);
  1436. X     if (Color) {
  1437. X        char option[20], *value; 
  1438. X        XColor used, exact;
  1439. X
  1440. X--- 88,95 -----
  1441. X     XtRealizeWidget(w_top);
  1442. X  
  1443. X     /* extract needed information */
  1444. X!    dpy = XtDisplay(w_top); win = XtWindow(w_label);
  1445. X!    D = DisplayPlanes(dpy,DefaultScreen(dpy));
  1446. X     if (Color) {
  1447. X        char option[20], *value; 
  1448. X        XColor used, exact; int n;
  1449. X***************
  1450. X*** 70,77
  1451. X     dpy = XtDisplay(w_top); win = XtWindow(w_top); D = DisplayPlanes(dpy,0);
  1452. X     if (Color) {
  1453. X        char option[20], *value; 
  1454. X!       XColor used, exact;
  1455. X!       int n;
  1456. X  
  1457. X        for(n=0; n<Ncolors; n++) {
  1458. X       strcpy(option, color_keys[n]);
  1459. X
  1460. X--- 92,98 -----
  1461. X     D = DisplayPlanes(dpy,DefaultScreen(dpy));
  1462. X     if (Color) {
  1463. X        char option[20], *value; 
  1464. X!       XColor used, exact; int n;
  1465. X  
  1466. X        for(n=0; n<Ncolors; n++) {
  1467. X       strcpy(option, color_keys[n]);
  1468. X***************
  1469. X*** 87,99
  1470. X          }
  1471. X       }
  1472. X        }
  1473. X!    XtSetArg(args[0], XtNfont, &font);
  1474. X!    XtSetArg(args[1], XtNforeground, &fg);
  1475. X!    XtSetArg(args[2], XtNbackground, &bg);
  1476. X!    XtSetArg(args[3], XtNwidth, &W);
  1477. X!    XtSetArg(args[4], XtNheight,&H);
  1478. X!    XtGetValues(w_label, args, FIVE);
  1479. X!    vchar = (font->ascent + font->descent);
  1480. X  
  1481. X     /* add callbacks on input-from-gnuplot-on-stdin & window-resized */
  1482. X     XtAddInput(0, XtInputReadMask, gnuplot, NULL);
  1483. X
  1484. X--- 108,118 -----
  1485. X          }
  1486. X       }
  1487. X        }
  1488. X!    XtSetArg(args[0], XtNwidth, &W);
  1489. X!    XtSetArg(args[1], XtNheight,&H);
  1490. X!    XtGetValues(w_label, args, (Cardinal)2);
  1491. X!    XtGetApplicationResources(w_top, &rv, resources, XtNumber(resources),NULL,0);
  1492. X!    vchar = (rv.font->ascent + rv.font->descent);
  1493. X  
  1494. X     /* add callbacks on input-from-gnuplot-on-stdin & window-resized */
  1495. X     XtAddInput(0, XtInputReadMask, gnuplot, NULL);
  1496. X***************
  1497. X*** 113,121
  1498. X     /* set scaling factor between internal driver & window geometry */
  1499. X     xscale = (double)W / 4096.;  yscale = (double)H / 4096.;  
  1500. X  
  1501. X-    /* return old pixmap  & GC, if any */
  1502. X-    if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
  1503. X- 
  1504. X     /* create new pixmap & GC */
  1505. X     pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), W, H, D);
  1506. X     gc = XCreateGC(dpy, pixmap, 0, NULL);
  1507. X
  1508. X--- 132,137 -----
  1509. X     /* set scaling factor between internal driver & window geometry */
  1510. X     xscale = (double)W / 4096.;  yscale = (double)H / 4096.;  
  1511. X  
  1512. X     /* create new pixmap & GC */
  1513. X     if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
  1514. X     pixmap = XCreatePixmap(dpy, RootWindow(dpy,DefaultScreen(dpy)), W, H, D);
  1515. X***************
  1516. X*** 117,123
  1517. X     if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
  1518. X  
  1519. X     /* create new pixmap & GC */
  1520. X!    pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), W, H, D);
  1521. X     gc = XCreateGC(dpy, pixmap, 0, NULL);
  1522. X     XSetFont(dpy, gc, font->fid);
  1523. X  
  1524. X
  1525. X--- 133,140 -----
  1526. X     xscale = (double)W / 4096.;  yscale = (double)H / 4096.;  
  1527. X  
  1528. X     /* create new pixmap & GC */
  1529. X!    if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
  1530. X!    pixmap = XCreatePixmap(dpy, RootWindow(dpy,DefaultScreen(dpy)), W, H, D);
  1531. X     gc = XCreateGC(dpy, pixmap, 0, NULL);
  1532. X     XSetFont(dpy, gc, rv.font->fid);
  1533. X  
  1534. X***************
  1535. X*** 119,125
  1536. X     /* create new pixmap & GC */
  1537. X     pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), W, H, D);
  1538. X     gc = XCreateGC(dpy, pixmap, 0, NULL);
  1539. X!    XSetFont(dpy, gc, font->fid);
  1540. X  
  1541. X     /* connect new pixmap to label widget */
  1542. X     XtSetArg(args[0], XtNbitmap, pixmap);
  1543. X
  1544. X--- 136,142 -----
  1545. X     if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
  1546. X     pixmap = XCreatePixmap(dpy, RootWindow(dpy,DefaultScreen(dpy)), W, H, D);
  1547. X     gc = XCreateGC(dpy, pixmap, 0, NULL);
  1548. X!    XSetFont(dpy, gc, rv.font->fid);
  1549. X  
  1550. X     /* erase pixmap */
  1551. X  #ifndef MOTIF
  1552. X***************
  1553. X*** 121,130
  1554. X     gc = XCreateGC(dpy, pixmap, 0, NULL);
  1555. X     XSetFont(dpy, gc, font->fid);
  1556. X  
  1557. X-    /* connect new pixmap to label widget */
  1558. X-    XtSetArg(args[0], XtNbitmap, pixmap);
  1559. X-    XtSetValues(w_label, args, ONE);
  1560. X- 
  1561. X     /* erase pixmap */
  1562. X     if (Color) {
  1563. X        XSetForeground(dpy, gc, bg);
  1564. X
  1565. X--- 138,143 -----
  1566. X     gc = XCreateGC(dpy, pixmap, 0, NULL);
  1567. X     XSetFont(dpy, gc, rv.font->fid);
  1568. X  
  1569. X     /* erase pixmap */
  1570. X  #ifndef MOTIF
  1571. X     if (Color) { /* Athena needs different erase for color and mono */
  1572. X***************
  1573. X*** 126,133
  1574. X     XtSetValues(w_label, args, ONE);
  1575. X  
  1576. X     /* erase pixmap */
  1577. X!    if (Color) {
  1578. X!       XSetForeground(dpy, gc, bg);
  1579. X        XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
  1580. X        XSetForeground(dpy, gc, fg);
  1581. X        XSetBackground(dpy, gc, bg);
  1582. X
  1583. X--- 139,148 -----
  1584. X     XSetFont(dpy, gc, rv.font->fid);
  1585. X  
  1586. X     /* erase pixmap */
  1587. X! #ifndef MOTIF
  1588. X!    if (Color) { /* Athena needs different erase for color and mono */
  1589. X! #endif
  1590. X!       XSetForeground(dpy, gc, rv.bg);
  1591. X        XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
  1592. X        XSetForeground(dpy, gc, rv.fg);
  1593. X        XSetBackground(dpy, gc, rv.bg);
  1594. X***************
  1595. X*** 129,136
  1596. X     if (Color) {
  1597. X        XSetForeground(dpy, gc, bg);
  1598. X        XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
  1599. X!       XSetForeground(dpy, gc, fg);
  1600. X!       XSetBackground(dpy, gc, bg);
  1601. X        }
  1602. X     else {
  1603. X        XSetFunction(dpy, gc, GXxor);
  1604. X
  1605. X--- 144,152 -----
  1606. X  #endif
  1607. X        XSetForeground(dpy, gc, rv.bg);
  1608. X        XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
  1609. X!       XSetForeground(dpy, gc, rv.fg);
  1610. X!       XSetBackground(dpy, gc, rv.bg);
  1611. X! #ifndef MOTIF
  1612. X        }
  1613. X     else {  
  1614. X        XSetFunction(dpy, gc, GXxor);
  1615. X***************
  1616. X*** 132,138
  1617. X        XSetForeground(dpy, gc, fg);
  1618. X        XSetBackground(dpy, gc, bg);
  1619. X        }
  1620. X!    else {
  1621. X        XSetFunction(dpy, gc, GXxor);
  1622. X        XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
  1623. X        XSetFunction(dpy, gc, GXcopyInverted);
  1624. X
  1625. X--- 148,154 -----
  1626. X        XSetBackground(dpy, gc, rv.bg);
  1627. X  #ifndef MOTIF
  1628. X        }
  1629. X!    else {  
  1630. X        XSetFunction(dpy, gc, GXxor);
  1631. X        XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
  1632. X        XSetFunction(dpy, gc, GXcopyInverted);
  1633. X***************
  1634. X*** 137,142
  1635. X        XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
  1636. X        XSetFunction(dpy, gc, GXcopyInverted);
  1637. X        }
  1638. X  
  1639. X     /* loop over accumulated commands from inboard driver */
  1640. X     for (n=0; n<nc; n++) {
  1641. X
  1642. X--- 153,159 -----
  1643. X        XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
  1644. X        XSetFunction(dpy, gc, GXcopyInverted);
  1645. X        }
  1646. X+ #endif
  1647. X  
  1648. X     /* connect new pixmap to label widget */
  1649. X     XtSetArg(args[0], LabelBPM, pixmap);
  1650. X***************
  1651. X*** 138,143
  1652. X        XSetFunction(dpy, gc, GXcopyInverted);
  1653. X        }
  1654. X  
  1655. X     /* loop over accumulated commands from inboard driver */
  1656. X     for (n=0; n<nc; n++) {
  1657. X        buf = commands[n];
  1658. X
  1659. X--- 155,164 -----
  1660. X        }
  1661. X  #endif
  1662. X  
  1663. X+    /* connect new pixmap to label widget */
  1664. X+    XtSetArg(args[0], LabelBPM, pixmap);
  1665. X+    XtSetValues(w_label, args, (Cardinal)1);
  1666. X+ 
  1667. X     /* loop over accumulated commands from inboard driver */
  1668. X     for (n=0; n<nc; n++) {
  1669. X        buf = commands[n];
  1670. X***************
  1671. X*** 157,163
  1672. X        else if (*buf == 'T') { 
  1673. X       sscanf(buf, "T%4d%4d", &x, &y);  
  1674. X       str = buf + 9; sl = strlen(str) - 1;
  1675. X!      sw = XTextWidth(font, str, sl);
  1676. X       switch(jmode) {
  1677. X          case LEFT:   sw = 0;     break;
  1678. X          case CENTRE: sw = -sw/2; break;
  1679. X
  1680. X--- 178,184 -----
  1681. X        else if (*buf == 'T') { 
  1682. X       sscanf(buf, "T%4d%4d", &x, &y);  
  1683. X       str = buf + 9; sl = strlen(str) - 1;
  1684. X!      sw = XTextWidth(rv.font, str, sl);
  1685. X       switch(jmode) {
  1686. X          case LEFT:   sw = 0;     break;
  1687. X          case CENTRE: sw = -sw/2; break;
  1688. X***************
  1689. X*** 205,210
  1690. X  
  1691. X  /*-----------------------------------------------------------------------------
  1692. X   *   gnuplot - Xt callback on input from gnuplot inboard X11 driver
  1693. X   *---------------------------------------------------------------------------*/
  1694. X  
  1695. X  static void
  1696. X
  1697. X--- 226,232 -----
  1698. X  
  1699. X  /*-----------------------------------------------------------------------------
  1700. X   *   gnuplot - Xt callback on input from gnuplot inboard X11 driver
  1701. X+  *   resize - Xt callback when window resized
  1702. X   *---------------------------------------------------------------------------*/
  1703. X  
  1704. X  static void
  1705. X***************
  1706. X*** 213,220
  1707. X     while (fgets(buf, Nbuf, stdin)) {
  1708. X       if (*buf == 'G') {                           /* enter graphics mode */
  1709. X       if (commands) {
  1710. X!         int n;
  1711. X!         for (n=0; n<nc; n++) XtFree(commands[n]);
  1712. X          XtFree(commands);
  1713. X          }
  1714. X       commands = NULL; nc = 0;
  1715. X
  1716. X--- 235,241 -----
  1717. X     while (fgets(buf, Nbuf, stdin)) {
  1718. X       if (*buf == 'G') {                           /* enter graphics mode */
  1719. X       if (commands) {
  1720. X!         int n; for (n=0; n<nc; n++) XtFree(commands[n]);
  1721. X          XtFree(commands);
  1722. X          }
  1723. X       commands = NULL; nc = 0;
  1724. X***************
  1725. X*** 228,237
  1726. X        }
  1727. X     if (feof(stdin) || ferror(stdin)) exit(0);
  1728. X     }
  1729. X- 
  1730. X- /*-----------------------------------------------------------------------------
  1731. X-  *   resize - Xt callback when window resized
  1732. X-  *---------------------------------------------------------------------------*/
  1733. X  
  1734. X  static void
  1735. X  resize(w, cd, e) Widget w; char *cd; XConfigureEvent *e; {
  1736. X
  1737. X--- 249,254 -----
  1738. X        }
  1739. X     if (feof(stdin) || ferror(stdin)) exit(0);
  1740. X     }
  1741. X  
  1742. X  static void
  1743. X  resize(w, cd, e) Widget w; char *cd; XConfigureEvent *e; {
  1744. END_OF_patch2a
  1745. if test 50620 -ne `wc -c <patch2a`; then
  1746.     echo shar: \"patch2a\" unpacked with wrong size!
  1747. fi
  1748. # end of overwriting check
  1749. fi
  1750. echo shar: End of shell archive.
  1751. exit 0
  1752.  
  1753. exit 0 # Just in case...
  1754. -- 
  1755. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1756. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1757. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1758. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1759.